<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>table模块快速使用</title>
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
</head>
<body>

<table id="demo" lay-filter="test"></table>

<script src="../layui/layui.js"></script>
<script>
    layui.use('table', function(){
        var table = layui.table;

        //第一个实例
        table.render({
            elem: '#demo'
            ,height: 312
            ,url: '../userlogin.do?method=findAllUsers' //数据接口
            ,page: true //开启分页
            ,cols: [[ //表头
                {field: 'id', title: 'ID', width:80},
                {field: 'name', title: '昵称', width:80},
                {field: 'password', title: '密码', width:80},
                {field: 'phone', title: '手机号码', width:80},
                {field: 'email', title: '邮箱', width:80},
                {field: 'photoPath', title: '头像路径', width:80},
            ]]
        });
    });
</script>
</body>
</html>